package fr.upstlse.glre.client.widgets.fields;

import com.google.gwt.user.client.ui.VerticalPanel;

import fr.upstlse.glre.client.RfgConstante;
import fr.upstlse.glre.client.widgets.FileUpload;
import fr.upstlse.glre.client.widgets.ListBox;

public class DepotFields {

	private VerticalPanel formPanel;
	private fr.upstlse.glre.client.widgets.TextArea description;
	private ListBox libelle;
	private FileUpload document;
	
	public DepotFields(VerticalPanel pFormPanelContent) {
		formPanel = pFormPanelContent;
		
		description = new fr.upstlse.glre.client.widgets.TextArea(RfgConstante.DEPOSER_FIELD_DESCRIPTION_LABEL, RfgConstante.DEPOSER_FIELD_DESCRIPTION_NAME);
		description.getTextarea().setCharacterWidth(20);
		description.getTextarea().setVisibleLines(2);
			
		libelle = new ListBox(RfgConstante.DEPOSER_FIELD_LIBELLE_LABEL, RfgConstante.DEPOSER_FIELD_LIBELLE_NAME);
		document = new FileUpload(RfgConstante.DEPOSER_FIELD_DOCUMENT_LABEL, RfgConstante.DEPOSER_FIELD_DOCUMENT_NAME);
		
		createFields();
	}
	
	private void createFields() {
		formPanel.add(description);
		formPanel.add(libelle);
		formPanel.add(document);
	}

	public VerticalPanel getFormPanel() {
		return formPanel;
	}

	public void setFormPanel(VerticalPanel formPanel) {
		this.formPanel = formPanel;
	}

	public fr.upstlse.glre.client.widgets.TextArea getDescription() {
		return description;
	}

	public void setDescription(fr.upstlse.glre.client.widgets.TextArea description) {
		this.description = description;
	}

	public ListBox getLibelle() {
		return libelle;
	}

	public void setLibelle(ListBox libelle) {
		this.libelle = libelle;
	}

	public FileUpload getDocument() {
		return document;
	}

	public void setDocument(FileUpload document) {
		this.document = document;
	}
}
